//
//  FourListTVCell.m
//  Logistics
//
//  Created by enzhoukeji on 2018/8/9.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "FourListTVCell.h"

@implementation FourListTVCell
-(void)layoutViews {
    
    self.titleImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"my_order"]];
    
    self.pendingBtn = [UIButton buttonWithTitle:@"待处理" withImageName:@"daichuli" withBGColor:nil Withlayer:NO];
    [self.pendingBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self.pendingBtn setImageEdgeInsets:UIEdgeInsetsMake(10, 30, 30,  10)];
    [self.pendingBtn setTitleEdgeInsets:UIEdgeInsetsMake(50, 0, 0, 60)];
    self.pendingBtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [self.pendingBtn addTarget:self action:@selector(pendingBtnClicek:) forControlEvents:UIControlEventTouchUpInside];
    
    self.processedBtn = [UIButton buttonWithTitle:@"已处理" withImageName:@"yichuli" withBGColor:nil Withlayer:NO];
    [self.processedBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    self.processedBtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [self.processedBtn setImageEdgeInsets:UIEdgeInsetsMake(10, 30, 30,  10)];
    [self.processedBtn setTitleEdgeInsets:UIEdgeInsetsMake(50, 0, 0, 60)];
    [self.processedBtn addTarget:self action:@selector(processedBtnClicek:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.titleImage];
    [self addSubview:self.pendingBtn];
    [self addSubview:self.processedBtn];

}
-(void)layoutSubviews{
    [self.titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(GTFixWidthFlaot(30));
    }];
    [self.pendingBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.titleImage.mas_right).offset(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo((self.width- GTFixWidthFlaot(30))/2);
    }];
    [self.processedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.pendingBtn.mas_right).offset(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo((self.width- GTFixWidthFlaot(30))/2);
    }];
    
}
-(void)setIndexPath:(NSIndexPath *)indexPath{
    _indexPath = indexPath;
}
-(void)pendingBtnClicek:(UIButton *)btn {
    if (self.delegate) {
        [self.delegate fourListwithIndexPath:self.indexPath withtype:@"1"];
    }
}
-(void)processedBtnClicek:(UIButton *)btn {
    if (self.delegate) {
        [self.delegate fourListwithIndexPath:self.indexPath withtype:@"2"];
    }
}
@end

@implementation FourListTVCellSecond
-(void)layoutViews {
    self.titleImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"qita"]];
    
    self.integralMallBtn = [UIButton buttonWithTitle:@"积分商城" withImageName:@"jifenshangcheng" withBGColor:nil Withlayer:NO];
    [self.integralMallBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self.integralMallBtn setImageEdgeInsets:UIEdgeInsetsMake(10, 40, 30,  10)];
    [self.integralMallBtn setTitleEdgeInsets:UIEdgeInsetsMake(50, 0, 0, 60)];
    self.integralMallBtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [self.integralMallBtn addTarget:self action:@selector(integralMallBtnClicek:) forControlEvents:UIControlEventTouchUpInside];
    
    self.walletBtn = [UIButton buttonWithTitle:@"我的钱包" withImageName:@"qianbao" withBGColor:nil Withlayer:NO];
    [self.walletBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [self.walletBtn setImageEdgeInsets:UIEdgeInsetsMake(10, 40, 30, 10)];
    [self.walletBtn setTitleEdgeInsets:UIEdgeInsetsMake(50, 0, 0, 60)];
    self.walletBtn.titleLabel.font = [UIFont systemFontOfSize:10];
    [self.walletBtn addTarget:self action:@selector(walletBtnClicek:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.titleImage];
    [self addSubview:self.integralMallBtn];
    [self addSubview:self.walletBtn];
    
}
-(void)layoutSubviews {
    [self.titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(GTFixWidthFlaot(30));
    }];
    [self.integralMallBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.titleImage.mas_right).offset(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo((self.width- GTFixWidthFlaot(30))/2);
    }];
    [self.walletBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.integralMallBtn.mas_right).offset(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo((self.width- GTFixWidthFlaot(30))/2);
    }];
}
-(void)setIndexPath:(NSIndexPath *)indexPath{
    _indexPath = indexPath;
}
-(void)integralMallBtnClicek:(UIButton *)btn {
    if (self.delegate) {
        [self.delegate fourListSecondwithIndexPath:self.indexPath withtype:@"1"];
    }
}
-(void)walletBtnClicek:(UIButton *)btn {
    if (self.delegate) {
        [self.delegate fourListSecondwithIndexPath:self.indexPath withtype:@"2"];
    }
}
@end


@implementation FourListTVCellThree
-(void)layoutViews {
    self.telImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dianhua"]];
    self.numaberLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor grayColor] withText:@"客服电话：0531-99997777"];
    [self addSubview:self.telImage];
    [self addSubview:self.numaberLabel];
}
-(void)layoutSubviews {
    [self.telImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(GTFixWidthFlaot(30));
    }];
    [self.numaberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.telImage.mas_right).offset(GTFixWidthFlaot(50));
        make.top.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        make.width.mas_equalTo(self.numaberLabel.mas_width);
    }];

}
@end

